global class PrimaryInfoUpdateOnAcc implements Database.Batchable<sObject>{
public   String query;

global database.querylocator start(Database.BatchableContext BC){
 return Database.getQueryLocator(query);
 }

global void execute(Database.BatchableContext BC, List<sObject> scope){
 /*    ID AcclocalAdvertiserRecordTypeID = RecordTypeHelper.GetRecordTypeID('Account', 'Local OOR Customer');
    ID ContlocalAdvertiserRecordTypeID = RecordTypeHelper.GetRecordTypeID('Contact', 'Local Advertiser');
    set<id> AccId = new set<id>();
    for(sObject s : scope){
        Contact Cnt = (Contact)s;
        AccId.add(cnt.accountid);*}
    
for(List<Account> accts: [select id, primary_contact__c, primary_phone__c,CleanPrimaryPhone_text__c ,(select id,name,phone,cleanphonetext__C from contacts where recordtypeid = :ContlocalAdvertiserRecordTypeID  and primary_indicator__c = true order by createddate desc limit 1) from account where recordtypeid=:AcclocalAdvertiserRecordTypeID  and id in :AccId]){
    for(account a: accts){
    Contact[] c = a.contacts;
    if(c.size() == 1){
        a.primary_contact__c = c[0].Name;
        a.primary_phone__c = c[0].phone;
        a.cleanprimaryphone_text__C = c[0].cleanphonetext__C;
    }}
    
    update accts;

}*/
}
    global void finish(Database.BatchableContext BC){
   /*     Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        mail.setToAddresses(new String[] {'sapna.s.jaamdar@accenture.com'});
        mail.setReplyTo('batch@acme.com');
        mail.setSenderDisplayName('Batch Processing');
        mail.setSubject('Batch Process Completed');
        mail.setPlainTextBody('Batch Process has completed');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
   */ }

}